<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:fragment xmlns="http://www.w3.org/1999/xhtml"
	xmlns:s="http://jboss.com/products/seam/taglib"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:a4j="http://richfaces.org/a4j">
	<a4j:outputPanel ajaxRendered="true">
		<h:form>
			<s:decorate template="/layout/edit.xhtml">
				<ui:define name="label">#{messages['label.ala.selecione']}</ui:define>
				<h:selectOneMenu 
						value="#{alaAction.entity.jornadaTrabalho}" 
						required="true"
						label="#{messages['label.jornada.trabalho']}"
						style="width:300px;">
						<s:selectItems 
							var="_jornadaTrabalho" 
							value="#{jornadaTrabalhoAction.resultList}" 
							label="#{_jornadaTrabalho.descricao}"
							itemValue="#{_jornadaTrabalho}"
							noSelectionLabel="#{messages['label.selecione']}"/>
							<f:converter converterId="br.com.o2solutions.siso.webapp.converter.EntidadeBaseConverter"/>
					</h:selectOneMenu>
			</s:decorate>
			<rich:panel>
		        <f:facet name="header">
		            <h:outputText value="#{messages['messages.ala.agentes.participantes'] alaAction.entity.descricao}"/>
		        </f:facet>
		        <rich:dataGrid 
		        	value="#{alaAction.entity.alaAgentes}" 
		        	var="alaAgente" 
		        	columns="3" 
		        	elements="9" 
		        	width="600px">
		            <rich:panel bodyClass="pbody">
		                <f:facet name="header">
		                    <h:outputText value="#{alaAgente.agente.nome}"></h:outputText>
		                </f:facet>
		                <h:panelGrid columns="2">
		                    <h:outputText value="#{messages['label.matricula']}" styleClass="label"></h:outputText>
		                    <h:outputText value="#{alaAgente.agente.matricula}" />
		                    <h:outputText value="#{messages['label.data.inclusao']}" styleClass="label"></h:outputText>
		                    <h:outputText value="#{alaAgente.dataInclusao}">
		                    	<f:convertDateTime pattern="dd/MM/yyyy"/>
		                    </h:outputText>
		                </h:panelGrid>
		            </rich:panel>
		            <f:facet name="footer">
		                <rich:datascroller></rich:datascroller>
		            </f:facet>
		        </rich:dataGrid>
	    	</rich:panel>       
		</h:form>
	</a4j:outputPanel>
</ui:fragment>
